home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / Unit1w.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-03-23  |  998 b   |  47 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, Buttons;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Memo1: TMemo;
  12.     Edit1: TEdit;
  13.     Edit2: TEdit;
  14.     BitBtn1: TBitBtn;
  15.     procedure BitBtn1Click(Sender: TObject);
  16.   private
  17.     { Private-Deklarationen }
  18.   public
  19.     { Public-Deklarationen }
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.   a,i:integer;
  25.   b:PChar;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TForm1.BitBtn1Click(Sender: TObject);
  32. begin
  33.   a:=0;
  34.   b:=PChar(Edit1.Text);
  35.   if StrLen(b)<4 then Application.MessageBox('Wrong Code','Sorry',MB_OK)
  36.   else
  37.   begin
  38.     a:=integer(Edit1.Text[1])*12+integer(Edit1.Text[2])*25+integer(Edit1.Text[3])*2+integer(Edit1.Text[4])*11;
  39.     a:=a*a*StrLen(b);
  40.     if IntToStr(a)=Edit2.Text then Application.MessageBox('You did it','Congratulations',MB_OK)
  41.     else Application.MessageBox('Wrong Code','Sorry',MB_OK);
  42.     //Edit2.Text:=IntToStr(a);
  43.   end;
  44. end;
  45.  
  46. end.
  47.